<?php
require('../vendor/autoload.php');

use BitWasp\Bitcoin\Key\Deterministic\HierarchicalKeyFactory;
use BitWasp\Bitcoin\Network\NetworkFactory;

$xprv = file_get_contents('./wallet/master-xprv');
$network = NetworkFactory::bitcoinRegtest();
$masterKey = HierarchicalKeyFactory::fromExtended($xprv,$network);

for($i=0;$i<3;$i++){
  $normal = $masterKey->deriveChild($i);
  $hardened = $masterKey->deriveChild($i | 0x80000000);
  echo 'normal => ' . $normal->getPrivateKey()->getHex() . PHP_EOL;
  echo 'hardened => ' . $hardened->getPrivateKey()->getHex(). PHP_EOL;
}  